package com.xfyr.mvpdemo.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xfyr.mvpdemo.R;

import java.util.List;

import bean.NewsBean;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 版权：易金 版权所有
 * <p>
 * 作者：suntinghui
 * <p>
 * 创建日期：2019/6/27 0027 09:15
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
public class AdapterMainList extends BaseQuickAdapter<NewsBean, AdapterMainList.ViewHolderMainList> {

    public AdapterMainList(@Nullable List<NewsBean> data) {
        super(R.layout.item_main_list, data);
    }

    @Override
    protected void convert(ViewHolderMainList helper, NewsBean item) {
        helper.tvTitle.setText(item.title);
        helper.tvContent.setText(item.description);
    }


    class ViewHolderMainList extends BaseViewHolder {
        @BindView(R.id.tv_title)
        TextView tvTitle;
        @BindView(R.id.tv_content)
        TextView tvContent;

        public ViewHolderMainList(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
